const helper = new Helper(this);
const modal = this.widgetObj.getModal();
const $widget = helper.get('演练标签页')?.widgetObj;
const drillModal = $widget?.getModal();
const type = drillModal?.type;


helper.getByCls('event-operate', false);
console.log('解除演练', type, modal.type);

if (modal.type === '解除演练') {
    let params = helper.parseVariable("screen_params");
    if (params) params.disableFlag = 3;
    drillModal.defaultData.disableFlag = 3;
    // this.pageObj.setVariables([{ name: 'screen_params', value: JSON.stringify(params) }]);

    if (type === 'dynamic') { // 动态
        $widget?.initDynamicRecords?.()
    } else if (type === 'task') { // 任务
        $widget?.initDistributeTasks?.()
    } else if (type === 'progress') { // 进度
        $widget.tab._option.defaultKey = 'progress'
        $widget.tab.render()
        $widget?.initEventStateProcessRecord?.()
    } else {
        $widget?.initDynamicRecords?.()
    }
}

if (['关闭演练', '结束演练'].includes(modal.type)) {
    this.getApiPage().navigateStage('832913037911392256')
}

this.hideWidget();